package com.leetroll.media.controller;

import com.leetroll.common.utils.AliyunOSSUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;


@RestController
@RequestMapping("/aliyun")
@Slf4j
public class AliyunController {

    @GetMapping("/makeUrl")
    public String makeUrl(@RequestParam(name ="key") String key) throws IOException {
        return AliyunOSSUtil.GetUrl(key, 1);//1年有效期
    }

}
